import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLEventListener;

/**
 * Created by WheelChen on 2017/5/18.
 *
 * 三角形
 */
public class Triangle implements GLEventListener {
    @Override
    public void init(GLAutoDrawable glAutoDrawable) {

    }

    @Override
    public void dispose(GLAutoDrawable glAutoDrawable) {

    }

    @Override
    public void display(GLAutoDrawable glAutoDrawable) {
        final GL2 gl2 = glAutoDrawable.getGL().getGL2();
        gl2.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
        gl2.glBegin(GL2.GL_TRIANGLES);
        gl2.glVertex3f( 0.0f, 0.5f, 0.0f);
        gl2.glVertex3f(-0.5f,-0.5f, 0.0f);
        gl2.glVertex3f( 0.5f,-0.5f, 0.0f);
        gl2.glEnd();

    }

    @Override
    public void reshape(GLAutoDrawable glAutoDrawable, int i, int i1, int i2, int i3) {

    }
}
